<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>量子风险评估报告</title>
    <style>
        body {
            font-family: 'Microsoft YaHei', Arial, sans-serif;
            line-height: 1.6;
            color: #333;
            max-width: 1200px;
            margin: 0 auto;
            padding: 20px;
            background-color: #f8f9fa;
        }
        h1, h2, h3, h4 { 
            color: #2c3e50;
            border-bottom: 2px solid #3498db;
            padding-bottom: 10px;
        }
        .container { 
            background-color: white;
            padding: 30px;
            border-radius: 8px;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        }
        .report-header { 
            text-align: center;
            margin-bottom: 30px;
        }
        table { 
            width: 100%;
            border-collapse: collapse;
            margin: 20px 0;
        }
        th, td { 
            padding: 12px;
            border: 1px solid #ddd;
            text-align: left;
        }
        th { 
            background-color: #f2f2f2;
            font-weight: bold;
        }
        tr:nth-child(even) { 
            background-color: #f9f9f9;
        }
        .data-section { 
            margin-bottom: 30px;
        }
        .risk-level { 
            display: inline-block;
            padding: 5px 10px;
            border-radius: 4px;
            font-weight: bold;
        }
        .risk-low { 
            background-color: #d4edda;
            color: #155724;
        }
        .risk-medium { 
            background-color: #fff3cd;
            color: #856404;
        }
        .risk-high { 
            background-color: #f8d7da;
            color: #721c24;
        }
        .footer { 
            text-align: center;
            margin-top: 40px;
            padding-top: 20px;
            border-top: 1px solid #ddd;
            color: #777;
            font-size: 0.9em;
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="report-header">
            <h1>量子风险评估报告</h1>
            <p>生成时间: 2025-08-25 07:53:22</p>
            <p>分析方法: 量子算法模拟</p>
        </div>
        
        
        <div class="data-section">
            <h2>投资组合风险概览</h2>
            <table>
                <tr>
                    <th>投资组合波动率</th>
                    <th>95% VaR</th>
                    <th>95% CVaR</th>
                    <th>极端风险 (99%)</th>
                    <th>风险等级</th>
                </tr>
                <tr>
                    <td>{portfolio_volatility:.2%}</td>
                    <td>{var_95:.2%}</td>
                    <td>{cvar_95:.2%}</td>
                    <td>{extreme_risk:.2%}</td>
                    <td><span class="risk-level {risk_class}">{risk_level}</span></td>
                </tr>
            </table>
        </div>
        
        <div class="data-section">
            <h2>资产风险分析</h2>
            <table>
                <tr>
                    <th>股票代码</th>
                    <th>平均回报率</th>
                    <th>波动率</th>
                    <th>最大回撤</th>
                    <th>风险评分</th>
                </tr>
        
                <tr>
                    <td>AAPL</td>
                    <td>0.04%</td>
                    <td>2.05%</td>
                    <td>-16.72%</td>
                    <td>56.97</td>
                </tr>
            
                <tr>
                    <td>MSFT</td>
                    <td>0.19%</td>
                    <td>1.89%</td>
                    <td>-10.27%</td>
                    <td>9.76</td>
                </tr>
            
                <tr>
                    <td>GOOG</td>
                    <td>0.35%</td>
                    <td>2.04%</td>
                    <td>-12.01%</td>
                    <td>5.81</td>
                </tr>
            
                <tr>
                    <td>AMZN</td>
                    <td>0.14%</td>
                    <td>1.80%</td>
                    <td>-11.26%</td>
                    <td>12.68</td>
                </tr>
            
                <tr>
                    <td>TSLA</td>
                    <td>-0.00%</td>
                    <td>2.00%</td>
                    <td>-20.50%</td>
                    <td>2171.45</td>
                </tr>
            
            </table>
        </div>
        
        <div class="data-section">
            <h2>风险评估分析</h2>
            <p>此风险评估基于量子蒙特卡洛模拟，综合考虑了多种风险因素。根据您的风险容忍度 ({risk_tolerance:.0%}) 进行了调整。</p>
            <p>VaR（在险价值）表示在给定置信水平下，投资组合可能遭受的最大损失。CVaR（条件在险价值）表示超过VaR阈值时的平均损失。</p>
        </div>
        
        
        <div class="footer">
            <p>量子金融分析系统 © 2025</p>
        </div>
    </div>
</body>
</html>